package com.amtf.datafile3.core.fil.parser;

import com.amtf.datafile3.DataException;
import com.amtf.datafile3.DataFieldParser;
import com.amtf.datafile3.core.std.type.StringField;

public class FilStringFieldParser extends AbsFilDataFieldParser<StringField, String> {

	public FilStringFieldParser(int columnStartIndex, int length) {
		super(columnStartIndex, length, null);
	}

	@Override
	protected String convertString(String value) throws DataException {
		if (value.length() == 0) {
			return null;
		}
		
		return value;
	}

	@Override
	public DataFieldParser clone() {
		FilStringFieldParser newObj = new FilStringFieldParser(columnStartIndex, length);
		return newObj;
	}
}
